package com.ruoyi.clothing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.clothing.mapper.SysOrderGoodsMapper;
import com.ruoyi.clothing.domain.SysOrderGoods;
import com.ruoyi.clothing.service.ISysOrderGoodsService;

/**
 * 订单Service业务层处理
 * 
 * @author weh
 * @date 2024-01-04
 */
@Service
public class SysOrderGoodsServiceImpl implements ISysOrderGoodsService 
{
    @Autowired
    private SysOrderGoodsMapper sysOrderGoodsMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public SysOrderGoods selectSysOrderGoodsById(Long id)
    {
        return sysOrderGoodsMapper.selectSysOrderGoodsById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param sysOrderGoods 订单
     * @return 订单
     */
    @Override
    public List<SysOrderGoods> selectSysOrderGoodsList(SysOrderGoods sysOrderGoods)
    {
        return sysOrderGoodsMapper.selectSysOrderGoodsList(sysOrderGoods);
    }

    /**
     * 新增订单
     * 
     * @param sysOrderGoods 订单
     * @return 结果
     */
    @Override
    public int insertSysOrderGoods(SysOrderGoods sysOrderGoods)
    {
        sysOrderGoods.setCreateTime(DateUtils.getNowDate());
        return sysOrderGoodsMapper.insertSysOrderGoods(sysOrderGoods);
    }

    /**
     * 修改订单
     * 
     * @param sysOrderGoods 订单
     * @return 结果
     */
    @Override
    public int updateSysOrderGoods(SysOrderGoods sysOrderGoods)
    {
        sysOrderGoods.setUpdateTime(DateUtils.getNowDate());
        return sysOrderGoodsMapper.updateSysOrderGoods(sysOrderGoods);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderGoodsByIds(Long[] ids)
    {
        return sysOrderGoodsMapper.deleteSysOrderGoodsByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteSysOrderGoodsById(Long id)
    {
        return sysOrderGoodsMapper.deleteSysOrderGoodsById(id);
    }
}
